package PenguinsFarm.Penguins.Stage
{
	import PenguinsFarm.Penguins.PenguinsRenderer;
	import PenguinsFarm.PenguinsFarmView;

	public class IdleStage implements IPenguinsStage
	{
		private var delayTime:Number;
		
		public function IdleStage( target:PenguinsRenderer )
		{
			target.getAssetPtr().gotoAndPlay( "idle" );
			
			delayTime	=	Math.random()*1.6 + 2.0;
			
			// Is water zone
			var view:PenguinsFarmView =	Global.CoreSNSFramework.getArchView( ShareMacros.MODULE_PENGUINS_FARM ) as PenguinsFarmView;
			var isInWater:Boolean = view.getCageBackground().isHitWater( target );
			target.applySwimmingStage( isInWater );
		}
		
		public function onFrameUpdate( deltaTime:Number ):void
		{
			delayTime	-=	deltaTime;
		}
		
		public function dispose():void
		{
			
		}
		
		public function isCompleteStage():Boolean
		{
			return delayTime <= 0.0;	
		}
	}
}